package com.example.product.config;

import com.example.product.pjo.MacCondition;
import com.example.product.pjo.Person;
import com.example.product.pjo.WindowCondition;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
public class PersonConfig {

    @Bean
    public Person jobb() {
        Person person = new Person();
        person.setName("job");
        person.setAge(18);
        return person;
    }

    @Conditional(MacCondition.class)
    @Bean(name = "jobs")
    public Person job() {
        Person person = new Person();
        person.setName("job");
        person.setAge(18);
        return person;
    }
    @Conditional(WindowCondition.class)
    @Bean(name = "bills")
    public Person bill() {
        Person person = new Person();
        person.setName("bill");
        person.setAge(18);
        return person;
    }
}
